package cn.gdcp.materialdtest;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;

public class AddStudent extends AppCompatActivity {
          EditText nameEdit;
         EditText ageEdit;
         EditText idEdit;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_student);
        Button button=(Button)findViewById(R.id.submit);
         nameEdit=findViewById(R.id.nameE);
         ageEdit=findViewById(R.id.ageE);
         idEdit=findViewById(R.id.numberE);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                String name=nameEdit.getText().toString();
                String age=ageEdit.getText().toString();
               String  id=idEdit.getText().toString();


              Intent intent=new Intent();
              intent.putExtra("AGE",age);
                intent.putExtra("NAME",name);
                intent.putExtra("ID",id);
                setResult(202,intent);
                finish();
            }
        });
    }


}
